home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
pc
/
pr42sdk
/
examples
/
projects
/
afilter
/
fl-lfill.c
next >
Wrap
C/C++ Source or Header
|
1995-10-07
|
2KB
|
83 lines
//=============================================================================
//
// Fl-lfill.c - Audio filter plug-in.
//
// Part of the Adobe Premiere 4.2 Plug-in Developer's Toolkit.
//
// Copyright 1993-96, Adobe Systems Incorporated, all rights reserved worldwide.
//
// Written by Nick Schlott.
//
// 1.00 1/25/94 njs Original version.
// 1.02 1/9/96 ba Updated for Premiere 4.2 and MSVC++ 2.2 & 4.2.
//
//-----------------------------------------------------------------------------
#include <windows.h>
#include "Compat.h"
#include "Premiere.h"
#define gaStereo 0x0100
#define ga16Bit 0x0200
BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return(TRUE);
}
//-----------------------------------------------------------------------------
// Perform the effect
short PRMEXPORT xFilter (short selector, AudioFilter theData)
{
short result = 0, flags, *wdest;
unsigned char *dest, *src;
long count, i;
switch (selector)
{
case fsExecute:
src = (*theData)->source;
dest = (*theData)->destination; // destination buffer
count = (*theData)->samplecount;
flags = (*theData)->flags;
memcpy(dest,(*theData)->source,count);
if (flags & gaStereo)
{
if (flags & ga16Bit)
{
wdest = (short*)dest;
count >>= 1;
for (i=1; i<count; i+=2)
wdest[i] = 0x0000;
}
else
{
for (i=1; i<count; i+=2)
dest[i] = 0x80;
}
}
break;
}
return(result);
}